/**
 * 权限API
 */
function PERM_BTN_INIT(BTNOBJ, BUSINESSNAME){
	BTNOBJ.html('');
	$.post('doAutAjax!loadAutBtnData', {},
			function(data){
				var HTML = '';
				//初始化按钮
				for(var i = 0; i < data.length; i++){
					code = data[i].code;
					//alert(BUSINESSNAME);
					HTML += '<a id="' + code + BUSINESSNAME + 'Btn" href="javascript:void(0);" class="easyui-linkbutton" onclick="OPEN_' + BUSINESSNAME + '_WINDOW(' + "'" + code + "'" + ');">' + data[i].name + '</a> ';
				}
				HTML += '<a id="close' + BUSINESSNAME + 'Btn" href="javascript:void(0);" class="easyui-linkbutton" onclick="curTabClose()">关闭</a>';
				
				//alert(HTML);
				
				BTNOBJ.html(HTML);
				//初始化按钮样式
				for(var i = 0; i < data.length; i++){
					if(data[i].code == 'view'){
						icon = 'icon-view';
					}else if(data[i].code == 'add'){
						icon = 'icon-add';
					}else if(data[i].code == 'edit'){
						icon = 'icon-edit';
					}else if(data[i].code == 'del'){
						icon = 'icon-remove';
					}else if(data[i].code == 'search'){
						icon = 'icon-search';
					}
					
					$('#'+ data[i].code + BUSINESSNAME + 'Btn').linkbutton({plain:true, iconCls:icon});				
				}
				$('#close' + BUSINESSNAME + 'Btn').linkbutton({plain:true,iconCls:'icon-close'});
		}, 'json');
}